import java.util.Scanner;

class Matrix {
    int row;
    int column;
    int[][] matrix;

    public Matrix(int row, int column) {
        this.row = row;
        this.column = column;
        this.matrix = new int[row][column];
    }

    public void inputMatrix(int i, int j, int input) {
        matrix[i][j] = input;
    }

    public static int[][] multiply(int[][] a,int row1,int column1, int[][] b,int row2,int column2) {
        int[][] ret = new int[row1][column2];

        for (int j = 0; j < column2; j++) {
            for (int i = 0; i < row1; i++) {
                int sum = 0;
                for (int k = 0; k < column1; k++) {
                    sum += a[i][k] * b[k][j];
                }
                ret[i][j] = sum;
            }
        }
        return ret;
    }

    public static void display(int[][] matrix) {
        for (int i = 0; i < matrix.length; i++) {
            for (int j = 0; j < matrix[0].length; j++) {
                System.out.print(matrix[i][j]+" ");
            }
            System.out.println();
        }
    }
}

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        //创建对象
        //m1
        int row1 = scanner.nextInt();
        int column1 = scanner.nextInt();
        Matrix matrix1 = new Matrix(row1,column1);
        for(int i=0; i<row1; i++) {
            for(int j=0; j<column1; j++) {
                int input = scanner.nextInt();
                matrix1.inputMatrix(i,j,input);
            }
        }

        //m2
        int row2 = scanner.nextInt();
        int column2 = scanner.nextInt();
        Matrix matrix2 = new Matrix(row2,column2);
        for(int i=0; i<row2; i++) {
            for(int j=0; j<column2; j++) {
                int input = scanner.nextInt();
                matrix2.inputMatrix(i,j,input);
            }
        }

        //乘积
        int[][] ret =  Matrix.multiply(matrix1.matrix,row1,column1, matrix2.matrix,row2,column2);
        Matrix.display(ret);

    }
}